// 二星 https://iai.sh.cn/problem/712
#include <bits/stdc++.h>
using namespace std;

int num[500002];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> num[i];
  }
  num[n + 1] = 0;

  int len = 0;
  int maxlen = 0; // 最长平台的长度
  for (int i = 1; i <= n + 1; i++) {
    if (num[i] == num[i - 1])
      len++;
    else {
      maxlen = max(maxlen, len);
      len = 1;
    }
  }
  int k = 0;

  for (int i = 1; i <= n + 1; i++) {
    if (num[i] == num[i - 1])
      len++;
    else {
      if (len == maxlen)
        k++;
      len = 1;
    }
  }
  cout << maxlen << " " << k;
  return 0;
}